package com.hzdl.cinema.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

public class Ticket {
    private Integer ticketId;

    private Integer scheduleId;

    private Integer studioId;

    private Integer seatId;

    private BigDecimal ticketPrice;

    private Date ticketTime;

    private Integer ticketStatus;

    private Integer userId;

    private Integer version;


    private Schedule schedule;
    private Studio studio;
    private Seat seat;
    private Play play;

    public Ticket(Integer ticketId, Integer ticketStatus, Integer version) {
        this.ticketId = ticketId;
        this.ticketStatus = ticketStatus;
        this.version = version;
    }

    public Schedule getSchedule() {
        return schedule;
    }

    public void setSchedule(Schedule schedule) {
        this.schedule = schedule;
    }

    public Studio getStudio() {
        return studio;
    }

    public void setStudio(Studio studio) {
        this.studio = studio;
    }

    public Seat getSeat() {
        return seat;
    }

    public void setSeat(Seat seat) {
        this.seat = seat;
    }

    public Play getPlay() {
        return play;
    }

    public void setPlay(Play play) {
        this.play = play;
    }

    public Integer getTicketId() {
        return ticketId;
    }

    public void setTicketId(Integer ticketId) {
        this.ticketId = ticketId;
    }

    public Integer getScheduleId() {
        return scheduleId;
    }

    public void setScheduleId(Integer scheduleId) {
        this.scheduleId = scheduleId;
    }

    public Integer getStudioId() {
        return studioId;
    }

    public void setStudioId(Integer studioId) {
        this.studioId = studioId;
    }

    public Integer getSeatId() {
        return seatId;
    }

    public void setSeatId(Integer seatId) {
        this.seatId = seatId;
    }

    public BigDecimal getTicketPrice() {
        return ticketPrice;
    }

    public void setTicketPrice(BigDecimal ticketPrice) {
        this.ticketPrice = ticketPrice;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getTicketTime() {
        return ticketTime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setTicketTime(Date ticketTime) {
        this.ticketTime = ticketTime;
    }

    public Integer getTicketStatus() {
        return ticketStatus;
    }

    public void setTicketStatus(Integer ticketStatus) {
        this.ticketStatus = ticketStatus;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Ticket(Integer ticketId, Date ticketTime, Integer version) {
        this.ticketId = ticketId;
        this.ticketTime = ticketTime;
        this.version = version;
    }

    public Ticket(Integer ticketId, Integer version) {
        this.ticketId = ticketId;
        this.version = version;
    }

    public Ticket(Integer ticketId, Integer scheduleId, Integer studioId, Integer seatId, BigDecimal ticketPrice, Date ticketTime, Integer ticketStatus, Integer userId, Integer version) {
        this.ticketId = ticketId;
        this.scheduleId = scheduleId;
        this.studioId = studioId;
        this.seatId = seatId;
        this.ticketPrice = ticketPrice;
        this.ticketTime = ticketTime;
        this.ticketStatus = ticketStatus;
        this.userId = userId;
        this.version = version;
    }

    public Ticket(Integer ticketId, Integer scheduleId, Integer studioId, Integer seatId, BigDecimal ticketPrice, Date ticketTime, Integer ticketStatus, Integer userId, Integer version, Schedule schedule, Studio studio, Seat seat, Play play) {
        this.ticketId = ticketId;
        this.scheduleId = scheduleId;
        this.studioId = studioId;
        this.seatId = seatId;
        this.ticketPrice = ticketPrice;
        this.ticketTime = ticketTime;
        this.ticketStatus = ticketStatus;
        this.userId = userId;
        this.version = version;
        this.schedule = schedule;
        this.studio = studio;
        this.seat = seat;
        this.play = play;
    }

    public Ticket() {
    }

    @Override
    public String toString() {
        return "Ticket{" +
                "ticketId=" + ticketId +
                ", scheduleId=" + scheduleId +
                ", studioId=" + studioId +
                ", seatId=" + seatId +
                ", ticketPrice=" + ticketPrice +
                ", ticketTime=" + ticketTime +
                ", ticketStatus=" + ticketStatus +
                ", userId=" + userId +
                ", version=" + version +
                ", schedule=" + schedule +
                ", studio=" + studio +
                ", seat=" + seat +
                ", play=" + play +
                '}';
    }
}